<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
</head>
<body>
<input type="button" id="btn" value="按钮"><br><br>
<input type="text " id="name"><br><br>
<input type="text " id="age"><br><br>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#btn").click(function () {
            $.ajax({
                url:"../Json/data.json",
                type:"get",
                dataType:"json",
                data:"",
                success:function (data) {
                    $("#name").val(data.name)
                    $("#age").val(data.age)
                },
                error:function () {
                    alert("ajax请求异常")
                }
            });
        })
    })
</script>